﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace The_LarX
{
    public class LarTemporizedTimer : LarTimer
    {
        public LarTemporizedTimer(GameScreen gs)
            : base(gs)
        {
        }

        public event EventHandler Tick;
        public int TickTime = 100;
        public bool KillAfterTick = false;
        public override void Update()
        {
            base.Update();

            if (Timer > TickTime)
            {
                Timer = 0;
                if (Tick != null)
                {
                    Tick(this, EventArgs.Empty);
                    if (KillAfterTick)
                    {
                        this.DisableComponent();
                    }
                }
            }
        }
    }
}
